import React, { PureComponent } from 'react'
import Cart from './page/Cart'

export class App extends PureComponent {

  constructor(props){
    super()
    this.state={
      isLogin:false
    }
  }
  loginClick(){
    localStorage.setItem('token','codewhy')
    // this.setState({
    //   isLogin:true,
    // })
    // 强制刷线
    this.forceUpdate()
  }
  render() {
    return (
      <div>
        <button onClick={()=>this.loginClick( )}>登陆</button>
        <Cart/>
      </div>
    )
  }
}

export default App